//类

import 'lib/Person.dart';
import 'lib/Rect.dart';
import 'lib/static.dart';
import 'lib/Duixiang.dart';
import 'lib/Qiangzhi.dart';
import 'lib/Liedui.dart';
void main(){
	Person person = new Person("老王", 30);
  print(person.age);
 var age = person.getUname();

 print("得到类的return 返回值-------------------->");
 print(age);
  print("访问其类的属性-------------------->");
  print(person.name);
//  print(person._name);//访问报错，带_符号的为私有参数 可以通过公有的方法访问

  print("通过公有的方法getUname访问私有属性_name-------------------->");
  String uname = person.getUnamew();
  print(uname);

   print("修饰符 get set的使用-------------------->");
   Rect rect = new Rect(5, 2);
   /*
   insert into ty_users select * from ty_users;
   
   
   */
   print(rect.areat);
print("静态成员的使用-------------------->");
  Jintai jintai = new Jintai();
  jintai.load();
  Jintai.printInfo();//调用静态方法直接使用类名称加该静态方法

  print("对象操作符--------------------->");
  Duixiang t = new Duixiang("对象");
  t?.show();//表示如果Duixiang t为空的话 就不执行show方法；否则就执行
  if(t is Duixiang){
    print("t is Duixiang");
  }else{
    print("p is not Duixiang");
  }

  print(t is Object);


  //as 强制转换

  var p1;
  p1 = "";
  p1 = new Qiangzhi("小红",22);
  (p1 as Qiangzhi).show();//强制转换成Qiangzhi 类

  (p1 as Qiangzhi)..name = "小白";
                  // ..age = 40;
  print((p1 as Qiangzhi).name);
  print((p1 as Qiangzhi).age);

// 列队操作
Liedui lie = new Liedui('奥巴马',123);
  lie..name = "周杰伦";
    ..age = 23;
}